package scaladuct.www

//import org.mortbay.jetty.webapp.WebAppContext
//import org.mortbay.jetty.Server
//import java.net.URL
//import java.lang.String
//import argo.jdom.JsonNodeBuilders._
//import argo.jdom._
//import java.io.{PrintWriter, Writer, File}
//import java.util.Date
//import java.text.SimpleDateFormat
//import org.mortbay.component.LifeCycle
//import org.mortbay.jetty.servlet.{FilterHolder, Context, ServletHolder}
//import javax.servlet._
//import chloroform.{ExtJSServlet, ProjectServlet, CookieServlet}
//import chloroform.oauth.OAuthFilter
//import sample.GDocBrowseServlet

/**
 * <p>
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: Nov 4, 2010
 * Time: 2:30:45 PM
 */

object Main extends Application {
//  var server: Server = new Server(8088)
//  val CONTEXTPATH: String = "/admin"
//  // for localhost:port/admin/index.html and what/ever else is in the webapp directory
//  val warUrl: URL = new File("src/main/webapp").toURI.toURL
//  val warUrlString: String = warUrl.toExternalForm
//  val webAppCtx: WebAppContext = new WebAppContext(warUrlString, CONTEXTPATH)
//
//  webAppCtx.addServlet(new ServletHolder(new GDocBrowseServlet), "/browse")
//  webAppCtx.addServlet(new ServletHolder(new ProjectServlet), "/project/*")
//  webAppCtx.addServlet(new ServletHolder(new CookieServlet), "/cookie/*")
//  webAppCtx.addServlet(new ServletHolder(new ExtJSServlet), "/extjs/*")
//  webAppCtx.addFilter(new FilterHolder(new OAuthFilter), "/*", 1)
//
//  server.setHandler(webAppCtx)
//
////  val context: Context = new Context(server, "/servlets", Context.SESSIONS)
////
////  context.addServlet(new ServletHolder(new CookieServlet), "/cookie/*")
//
//  //context.addFilter(new FilterHolder(new LookupServiceInstaller()), "/cookie/*", 15)
//  //context.getServletContext.addListener("scaladuct.www.DefaultConfigPageRegisterLookupFactory")
//
//
//  server.start


}

//class LookupServiceInstaller extends Filter {
//  def destroy = {}
//
//  def doFilter(req: ServletRequest, res: ServletResponse, chain: FilterChain) = {
//    chain.doFilter(req, res)
//  }
//
//  def init(cfg: FilterConfig) = {
//    val lookupService = new DefaultConfigPageRegisterLookupFactory
//    lookupService.install(cfg.getServletContext)
//  }
//}